3.1.97 \(\int (c+d x) (a+a \sin (e+f x)) \, dx\) [97]

Optimal. Leaf size=45 \[ \frac {a (c+d x)^2}{2 d}-\frac {a (c+d x) \cos (e+f x)}{f}+\frac {a d \sin (e+f x)}{f^2} \]

[Out]

1/2*a*(d*x+c)^2/d-a*(d*x+c)*cos(f*x+e)/f+a*d*sin(f*x+e)/f^2

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {3398, 3377, 2717} \begin {gather*} -\frac {a (c+d x) \cos (e+f x)}{f}+\frac {a (c+d x)^2}{2 d}+\frac {a d \sin (e+f x)}{f^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)*(a + a*Sin[e + f*x]),x]

[Out]

(a*(c + d*x)^2)/(2*d) - (a*(c + d*x)*Cos[e + f*x])/f + (a*d*Sin[e + f*x])/f^2

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3398

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, (a + b*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[n, 0] && (EqQ[n, 1] ||
IGtQ[m, 0] || NeQ[a^2 - b^2, 0])

Rubi steps

\begin {align*} \int (c+d x) (a+a \sin (e+f x)) \, dx &=\int (a (c+d x)+a (c+d x) \sin (e+f x)) \, dx\\ &=\frac {a (c+d x)^2}{2 d}+a \int (c+d x) \sin (e+f x) \, dx\\ &=\frac {a (c+d x)^2}{2 d}-\frac {a (c+d x) \cos (e+f x)}{f}+\frac {(a d) \int \cos (e+f x) \, dx}{f}\\ &=\frac {a (c+d x)^2}{2 d}-\frac {a (c+d x) \cos (e+f x)}{f}+\frac {a d \sin (e+f x)}{f^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.19, size = 51, normalized size = 1.13 \begin {gather*} -\frac {a ((e+f x) (d e-2 c f-d f x)+2 f (c+d x) \cos (e+f x)-2 d \sin (e+f x))}{2 f^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)*(a + a*Sin[e + f*x]),x]

[Out]

-1/2*(a*((e + f*x)*(d*e - 2*c*f - d*f*x) + 2*f*(c + d*x)*Cos[e + f*x] - 2*d*Sin[e + f*x]))/f^2

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(89\) vs. \(2(43)=86\).
time = 0.03, size = 90, normalized size = 2.00

method result size
risch \(\frac {d a \,x^{2}}{2}+a c x -\frac {a \left (d x +c \right ) \cos \left (f x +e \right )}{f}+\frac {a d \sin \left (f x +e \right )}{f^{2}}\) \(42\)
derivativedivides \(\frac {-a c \cos \left (f x +e \right )+\frac {a d e \cos \left (f x +e \right )}{f}+\frac {a d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}+a c \left (f x +e \right )-\frac {a d e \left (f x +e \right )}{f}+\frac {a d \left (f x +e \right )^{2}}{2 f}}{f}\) \(90\)
default \(\frac {-a c \cos \left (f x +e \right )+\frac {a d e \cos \left (f x +e \right )}{f}+\frac {a d \left (\sin \left (f x +e \right )-\left (f x +e \right ) \cos \left (f x +e \right )\right )}{f}+a c \left (f x +e \right )-\frac {a d e \left (f x +e \right )}{f}+\frac {a d \left (f x +e \right )^{2}}{2 f}}{f}\) \(90\)
norman \(\frac {\frac {2 a c \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {a \left (c f -d \right ) x}{f}+\frac {a \left (c f +d \right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}+\frac {d a \,x^{2}}{2}+\frac {2 d a \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f^{2}}+\frac {d a \,x^{2} \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{2}}{1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )}\) \(112\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)*(a+a*sin(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/f*(-a*c*cos(f*x+e)+a/f*d*e*cos(f*x+e)+a/f*d*(sin(f*x+e)-(f*x+e)*cos(f*x+e))+a*c*(f*x+e)-a/f*d*e*(f*x+e)+1/2*
a/f*d*(f*x+e)^2)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 103 vs. \(2 (45) = 90\).
time = 0.31, size = 103, normalized size = 2.29 \begin {gather*} \frac {2 \, {\left (f x + e\right )} a c + \frac {{\left (f x + e\right )}^{2} a d}{f} - 2 \, a c \cos \left (f x + e\right ) - \frac {2 \, {\left (f x + e\right )} a d e}{f} + \frac {2 \, a d \cos \left (f x + e\right ) e}{f} - \frac {2 \, {\left ({\left (f x + e\right )} \cos \left (f x + e\right ) - \sin \left (f x + e\right )\right )} a d}{f}}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*(a+a*sin(f*x+e)),x, algorithm="maxima")

[Out]

1/2*(2*(f*x + e)*a*c + (f*x + e)^2*a*d/f - 2*a*c*cos(f*x + e) - 2*(f*x + e)*a*d*e/f + 2*a*d*cos(f*x + e)*e/f -
 2*((f*x + e)*cos(f*x + e) - sin(f*x + e))*a*d/f)/f

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 53, normalized size = 1.18 \begin {gather*} \frac {a d f^{2} x^{2} + 2 \, a c f^{2} x + 2 \, a d \sin \left (f x + e\right ) - 2 \, {\left (a d f x + a c f\right )} \cos \left (f x + e\right )}{2 \, f^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*(a+a*sin(f*x+e)),x, algorithm="fricas")

[Out]

1/2*(a*d*f^2*x^2 + 2*a*c*f^2*x + 2*a*d*sin(f*x + e) - 2*(a*d*f*x + a*c*f)*cos(f*x + e))/f^2

________________________________________________________________________________________

Sympy [A]
time = 0.09, size = 68, normalized size = 1.51 \begin {gather*} \begin {cases} a c x - \frac {a c \cos {\left (e + f x \right )}}{f} + \frac {a d x^{2}}{2} - \frac {a d x \cos {\left (e + f x \right )}}{f} + \frac {a d \sin {\left (e + f x \right )}}{f^{2}} & \text {for}\: f \neq 0 \\\left (a \sin {\left (e \right )} + a\right ) \left (c x + \frac {d x^{2}}{2}\right ) & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*(a+a*sin(f*x+e)),x)

[Out]

Piecewise((a*c*x - a*c*cos(e + f*x)/f + a*d*x**2/2 - a*d*x*cos(e + f*x)/f + a*d*sin(e + f*x)/f**2, Ne(f, 0)),
((a*sin(e) + a)*(c*x + d*x**2/2), True))

________________________________________________________________________________________

Giac [A]
time = 1.51, size = 47, normalized size = 1.04 \begin {gather*} \frac {1}{2} \, a d x^{2} + a c x + \frac {a d \sin \left (f x + e\right )}{f^{2}} - \frac {{\left (a d f x + a c f\right )} \cos \left (f x + e\right )}{f^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*(a+a*sin(f*x+e)),x, algorithm="giac")

[Out]

1/2*a*d*x^2 + a*c*x + a*d*sin(f*x + e)/f^2 - (a*d*f*x + a*c*f)*cos(f*x + e)/f^2

________________________________________________________________________________________

Mupad [B]
time = 0.10, size = 54, normalized size = 1.20 \begin {gather*} \frac {a\,\left (d\,x^2+2\,c\,x\right )}{2}-\frac {\frac {a\,f\,\left (2\,c\,\cos \left (e+f\,x\right )+2\,d\,x\,\cos \left (e+f\,x\right )\right )}{2}-a\,d\,\sin \left (e+f\,x\right )}{f^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*sin(e + f*x))*(c + d*x),x)

[Out]

(a*(2*c*x + d*x^2))/2 - ((a*f*(2*c*cos(e + f*x) + 2*d*x*cos(e + f*x)))/2 - a*d*sin(e + f*x))/f^2

________________________________________________________________________________________